package com.foreverwin.generator.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;

/**
 * druid 配置多数据源
 * 
 * @author ruoyi
 */
@Configuration
public class DruidConfig
{
    @Bean
    @ConfigurationProperties("spring.datasource.druid.master")
    public DataSource dataSource()
    {
        DruidDataSource dataSource = new DruidDataSource();
        //dataSource.setUrl("jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC");
        dataSource.setUrl("jdbc:oracle:thin:@10.199.199.92:1521:DEV");
        dataSource.setUsername("WIP");
        dataSource.setPassword("wip");
        return dataSource;
    }

}
